<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>코오롱</title>
<link rel="stylesheet" type="text/css" href="${requestScope.contextPath}/css/import.css" />
<script type="text/javascript" src="${requestScope.contextPath}/js/jquery-ui-1.8.14.custom/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="${requestScope.contextPath}/js/common.js"></script>
<c:set var="userAgent" value="${header['User-Agent']}" />
<fmt:setBundle basename="com.kolon.config.properties.config" var="config" />
<c:if test="${fn:indexOf(userAgent, 'Android') != -1}"><c:set var="platForm" value="Android" /></c:if>
<c:if test="${fn:indexOf(userAgent, 'iPhone') != -1}"><c:set var="platForm" value="iPhone" /></c:if>
<% String schTp = com.kolon.framework.util.ComUtil.nullChk(request.getParameter("schTp")); %>
<script type="text/javascript">
function appBack() {
	<%if ("".equals(schTp)) {%>
	document.location.href='${requestScope.contextPath}/business/mKolonInt/mKolonIntList.do?strMode=18&SearchUserName=&SearchTitle=&SortAscDesc=desc&page=${page}&endY=${param.endY}';
	<%}else if ("R".equals(schTp)) {%>
	document.location.href='${requestScope.contextPath}/business/mKolonInt/mKolonIntSearchList.do';
	<%}else{%>
	history.back(-1);
	<%}%>
}
</script>
<c:choose>
<c:when test="${platForm eq 'iPhone'}">	
<script type="text/javascript" src="${requestScope.contextPath}/js/cubiq-iscroll/iscroll.js"></script>
<script>
var myScroll;
function loaded() {
	myScroll = new iScroll('wrapper', { 
		checkDOMChanges: true,
		zoom: true
	});
}
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
window.addEventListener('DOMContentLoaded', setTimeout(function () { loaded(); }, 200), false);
$(document).ready(function(){ 
	$('#viewPage').find('img').each(function() {
		w = $(this).attr('width');
		h = $(this).attr('height');
		if (w > 320 || w == undefined) {
			imgUrl = "location.href='/imgZoom.jsp?imgUrl=" + $(this).attr('src')+"&width="+$(this).attr('width')+"&height="+$(this).attr('height')+"'";
			$(this).attr('width', '320');
			$(this).attr('height', Math.round(h*(320/w)));
			$(this).attr('onClick', imgUrl);
		}
	});
});
</script>
<script language="javascript"">
function conDelete(url) {
	var del;
	del=confirm("삭제하시겠습니까?");
	if (del==true) {
		location.href=url;
	}
}

function conRecommend(url) {
	var recom;
	recom=confirm("추천하시겠습니까?");
	if (recom==true) {
		location.href=url;
	}
}
</script>
<style type="text/css" media="all">
/*원본 : #wrapper { position:absolute; z-index:1; top:48px; bottom:0px; left:0; width:320px;  overflow:auto; }*/
	#wrapper { position:absolute; z-index:1; top:48px; bottom:0px; left:0; width:100%;  overflow:auto; }
	#scroller { position:absolute; z-index:1; -webkit-tap-highlight-color:rgba(0,0,0,0); 
		width:100%; padding:0; background:#fff; }
</style>
</head>
<body>
	<div id="wrap">
		<div class="header">
			<h1>코오롱지식인</h1>
		</div><!-- // header -->
		<div id="wrapper" class="content">
			<div id="scroller">
			<div class="news knowledge">
				<ul>
					<li><span class="bold">${viewMap.Title }</span><span class="date1"> ${viewMap.UserName } |  ${viewMap.CreateDate } | 조회: ${viewMap.ViewCnt }</span></li>
				</ul>
				<div class="int_view">
				<c:out value="${viewMap.Contents }" escapeXml="false" />
				</div>
				<div class="btn_area">
					<p class="left_area"><a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntComent.do?ArticleCD=${viewMap.ArticleCD }"><img src="${requestScope.contextPath}/images/btn/btn_view.gif" alt="댓글보기" /></a></p>
					<c:choose>
       					<c:when test="${viewMap.UserID eq sessionScope.SESSION_USER_INFO.userId}">
							<p class="left_area"><a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntModifyForm.do?ArticleCD=${viewMap.ArticleCD}"><img src="${requestScope.contextPath}/images/btn/btn_modify3.gif" alt="수정" /></a></p>
							<p class="left_area"><img onclick="conDelete('/business/mKolonInt/mKolonIntDel.do?ArticleCD=${viewMap.ArticleCD}')" src="${requestScope.contextPath}/images/btn/btn_del2.gif" alt="삭제" /></p>
						</c:when>
						<c:otherwise>
							<p class="left_area"><img onclick="conRecommend('${requestScope.contextPath}/business/mKolonInt/mKolonIntRecommend.do?ArticleCD=${viewMap.ArticleCD}&schTp=<%=schTp%>')" src="${requestScope.contextPath}/images/btn/recommend.gif" alt="추천하기" /></p>
						</c:otherwise>
					</c:choose>
					<div class="right_area">
						<p><a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntComentWrite.do?ArticleCD=${viewMap.ArticleCD}"><img src="${requestScope.contextPath}/images/btn/btn_write.gif" alt="댓글쓰기" /></a></p>
						<p><a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntReplyForm.do?ArticleCD=${viewMap.ArticleCD}"><img src="${requestScope.contextPath}/images/btn/btn_write2.gif" alt="답글쓰기" /></a></p>
					</div>
				</div>
				<p class="btn_more btn_view"><a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntList.do?strMode=18&SearchUserName=&SearchTitle=&SortAscDesc=desc&page=${page}&endY=${param.endY}"><img src="${requestScope.contextPath}/images/btn/btn_view2.gif" alt="목록보기" /></a></p>
			</div>
			</div>
		</div><!-- // content -->
	</div><!-- // wrap -->
</body>
</html>

</c:when>
<c:otherwise>

<script type="text/javascript">
$(document).ready(function(){ 
	$('#viewPage').find('img').each(function() {
		w = $(this).attr('width');
		h = $(this).attr('height');
		if (w > 320 || w == undefined) {
			imgUrl = "location.href='/imgZoom.jsp?imgUrl=" + $(this).attr('src')+"&width="+$(this).attr('width')+"&height="+$(this).attr('height')+"'";
			$(this).attr('width', '320');
			$(this).attr('height', Math.round(h*(320/w)));
			$(this).attr('onClick', imgUrl);
		}
	});
});
</script>
<script language="javascript"">
function conDelete(url) {
	var del;
	del=confirm("삭제하시겠습니까?");
	if (del==true) {
		location.href=url;
	}
}

function conRecommend(url) {
	var recom;
	recom=confirm("추천하시겠습니까?");
	if (recom==true) {
		location.href=url;
	}
}
</script>
<style type="text/css" media="all">
	<c:if test="${tbChk eq 'Y'}">
	.content{width:600px;}
	</c:if>
</style>
</head>
<body>
	<div id="wrap">
		<div class="header">
			<h1>코오롱지식인</h1>
		</div><!-- // header -->
		<div class="content">
			<div class="news knowledge">
				<ul>
					<li><span class="bold">${viewMap.Title }</span><span class="date1"> ${viewMap.UserName } |  ${viewMap.CreateDate } | 조회: ${viewMap.ViewCnt }</span></li>
				</ul>
				<div class="int_view">
				<c:out value="${viewMap.Contents }" escapeXml="false" />
				</div>
				<div class="btn_area">
					<p class="left_area"><a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntComent.do?ArticleCD=${viewMap.ArticleCD }&schTp=<%=schTp%>"><img src="${requestScope.contextPath}/images/btn/btn_view.gif" alt="댓글보기" /></a></p>
					<c:choose>
       					<c:when test="${viewMap.UserID eq sessionScope.SESSION_USER_INFO.userId}">
							<p class="left_area">
							<c:choose>
							<c:when test="${edtChk eq 'Y'}"><a href="javascript:alert('PC에서 등록한 글은 PC에서만 수정이 가능 합니다.');"><img src="${requestScope.contextPath}/images/btn/btn_modify3.gif" alt="수정" /></a></c:when>
							<c:otherwise>
							<a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntModifyForm.do?ArticleCD=${viewMap.ArticleCD}"><img src="${requestScope.contextPath}/images/btn/btn_modify3.gif" alt="수정" /></a>
							</c:otherwise>
							</c:choose>
							</p>
							<p class="left_area"><img onclick="conDelete('/business/mKolonInt/mKolonIntDel.do?ArticleCD=${viewMap.ArticleCD}')" src="${requestScope.contextPath}/images/btn/btn_del2.gif" alt="삭제" /></p>
						</c:when>
						<c:otherwise>
							<p class="left_area"><img onclick="conRecommend('${requestScope.contextPath}/business/mKolonInt/mKolonIntRecommend.do?ArticleCD=${viewMap.ArticleCD}&schTp=<%=schTp%>')" src="${requestScope.contextPath}/images/btn/recommend.gif" alt="추천하기" /></p>
						</c:otherwise>
					</c:choose>
					<div class="right_area">
						<p><a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntComentWrite.do?ArticleCD=${viewMap.ArticleCD}"><img src="${requestScope.contextPath}/images/btn/btn_write.gif" alt="댓글쓰기" /></a></p>
						<p><a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntReplyForm.do?ArticleCD=${viewMap.ArticleCD}"><img src="${requestScope.contextPath}/images/btn/btn_write2.gif" alt="답글쓰기" /></a></p>
					</div>
				</div>
				<p class="btn_more btn_view"><a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntList.do?strMode=18&SearchUserName=&SearchTitle=&SortAscDesc=desc&page=${page}&endY=${param.endY}"><img src="${requestScope.contextPath}/images/btn/btn_view2.gif" alt="목록보기" /></a></p>
			</div>
		</div><!-- // content -->
	</div><!-- // wrap -->
</body>
</html>

</c:otherwise>
</c:choose>